<?php
/**
 * Created by PhpStorm
 * User: Jhinwy
 * Date: 5/10/24
 * Time: 6:11 PM
 */

namespace app\common\model\landing_page;

use app\common\model\auth\Admin;
use app\common\model\BaseModel;
use app\common\model\promotion\PromotionLink;
use app\common\model\quickapp\Quickapp;

class LandingPage extends BaseModel
{

    protected $name = 'landing_page';


    public function getAdminNameAttr($value, $data)
    {
        return Admin::where('id', $data['admin_id'])->value('name');
    }


    public function getPlatformNameAttr($value, $data)
    {
        return Quickapp::where('id', $data['platform'])->value('name');
    }


    public function getHapUrlAttr($value, $data)
    {
        return PromotionLink::where('id', $data['promotion_link_id'])->value('hap_url');
    }
}
